﻿using HalconDotNet;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ImageToolCircle
{
    public enum MeasureDir
    {
        BlackToWhite,
        WhiteToBlack
    }
    public enum MeasureSelect
    {
        all,
        first,
        last
    }
    [Serializable]
    public class ToolSetting
    {
        public ToolSetting()
        {

            RowCenter = 0.0;
            ColumnCenter = 0.0;
            Length1 = 20.0;
            Length2 = 10.0;
            Radius = 0.0;
            StartAngle = 0;
            EndAngle = 360;
            MeasureWidth = 20;
            Sigma = 1.0;
            Threshold = 3.0;
            MeasureDir = MeasureDir.BlackToWhite;
            ShowCircle = true;
            MeasureNums = 20;
            MeasureSelect = MeasureSelect.all;
            PointOrderCW = true;

        }
        [CategoryAttribute("SearchWnd")]
        public double RowCenter
        {
            get;
            set;
        }
        [CategoryAttribute("SearchWnd")]
        public double ColumnCenter
        {
            get;
            set;
        }
        [CategoryAttribute("SearchWnd")]
        public double Radius
        {
            get;
            set;
        }
        [CategoryAttribute("SearchWnd")]
        public double Length1
        {
            get;
            set;
        }
        [CategoryAttribute("SearchWnd")]
        public double Length2
        {
            get;
            set;
        }
        [CategoryAttribute("SearchWnd")]
        public double StartAngle
        {
            get;
            set;
        }
        [CategoryAttribute("SearchWnd")]
        public double EndAngle
        {
            get;
            set;
        }

        [CategoryAttribute("SearchWnd")]
        public double MeasureWidth
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public double Sigma
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public double Threshold
        {
            get;
            set;
        }

        [CategoryAttribute("MeasureSetting")]
        public MeasureDir MeasureDir
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public MeasureSelect MeasureSelect
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public double MinScore
        {
            get;
            set;
        }

        [CategoryAttribute("MeasureSetting")]
        public bool PointOrderCW
        {
            get;
            set;
        }
        [CategoryAttribute("UI")]
        public bool ShowMeasureWnd
        {
            get;
            set;
        }
        [CategoryAttribute("UI")]
        public bool ShowMeasurePt
        {
            get;
            set;
        }
        [CategoryAttribute("UI")]
        public bool ShowMeasureResultLine
        {
            get;
            set;
        }
        [CategoryAttribute("MeasureSetting")]
        public int MeasureNums
        {
            get;
            set;
        }
        [CategoryAttribute("UI")]
        public bool ShowCircle
        {
            get;
            set;
        }
    }
}
